home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / flofix10.lha / FlowFix.rexx < prev   
OS/2 REXX Batch file  |  1995-01-01  |  2KB  |  54 lines

  1. /* Add Carret to HLO and FLO flow files for Mebbsnet if using Trapdoor */
  2.  
  3. FixDir = "Ram:"
  4. FixFile = "ListOfFlowFiles"
  5. OutBoundDir = "Mail:Out/"
  6. FilePattern = "*(C|F|H)LO"
  7. TempFlowFile = "123.456.789.0.FLO"
  8. NewNodeNumber = ""
  9. NewFlowNode = ""
  10.  
  11. say " "
  12. say "FlowFix v1.0 by Andrew Kendall 1-Jan-95"
  13. say " "
  14. address command "List >"FixDir||FixFile" "OutBoundDir||FilePattern" lformat %n"
  15. address command "Sort "FixDir||FixFile" "FixDir||FixFile
  16.  
  17. open('ListFile',FixDir||FixFile,'R')
  18. do forever
  19.         NodeNumber = readln('ListFile')
  20.         if length(NodeNumber) = 0 then do
  21.                 say "End of Outbound Dir Scanning"
  22.         call close('ListFile')
  23.         nop
  24.         address command "Delete >NIL: "FixDir||FixFile
  25.                 exit
  26.         end
  27.     say "Working on file :" NodeNumber
  28.         open('FloFile',OutBoundDir||NodeNumber,'R')
  29.     open('NewFile',OutBoundDir||TempFlowFile,'W')
  30.     do forever
  31.         FlowNode = readln('FloFile')
  32.         NewFlowNode = FlowNode
  33.         if length(FlowNode) = 0 then leave
  34.         if upper(left(right(FlowNode,3),2)) = "MO" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  35.         if upper(left(right(FlowNode,3),2)) = "TU" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  36.         if upper(left(right(FlowNode,3),2)) = "WE" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  37.         if upper(left(right(FlowNode,3),2)) = "TH" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  38.         if upper(left(right(FlowNode,3),2)) = "FR" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  39.         if upper(left(right(FlowNode,3),2)) = "SA" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  40.         if upper(left(right(FlowNode,3),2)) = "SU" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  41.         if upper(right(FlowNode,3)) = "TIC" then if left(FlowNode,1) ~= "^" then NewFlowNode = "^"||FlowNode
  42.     if length(NewFlowNode) ~= 0 then writeln('NewFile',NewFlowNode)
  43.     NewFlowNode = ""
  44.     end
  45. call close('NewFile')
  46. call close('FloFile')
  47. nop
  48. address command "Delete >NIL: "OutBoundDir||NodeNumber
  49. address command "Rename >NIL: "OutBoundDir||TempFlowFile OutBoundDir||NodeNumber
  50. end
  51. close('ListFile')
  52. nop
  53. address command "Delete "FixDir||FixFile
  54.